package org.sport.repository;

import org.sport.model.entityModel.ActivitytableEntity;
import org.sport.model.entityModel.DiscusstableEntity;
import org.sport.model.entityModel.UsertableEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;






@Repository
public interface DiscusstableRepository extends JpaRepository<DiscusstableEntity,Integer> {



    @Transactional
    @Query("select discuss from DiscusstableEntity discuss where discuss.activitytableByActivityId =?1")
    public List<DiscusstableEntity> findActivityDisByActId(ActivitytableEntity activitytableEntity);




    @Transactional
    @Query("select discuss from DiscusstableEntity discuss where discuss.followId =?1")
    public List<DiscusstableEntity> findFollowDisById(DiscusstableEntity followId);




    @Transactional
    @Query("select discuss from DiscusstableEntity discuss where discuss.usertableByUserId =?1")
    public List<DiscusstableEntity> findDisByUserId(UsertableEntity userid);
}
